<?php
/**
 * @file
 *   Unlinks the Facebook and Untold accounts of the current Facebook user.
 */

require_once ("../utils/query.php");

session_start();
if(empty($_SESSION['facebook_id']))
	die("Not logged into facebook.");
$facebook_id = $_SESSION['facebook_id'];

query_delete_user($facebook_id);

if(mysql_affected_rows() > 0)
	die('{ "success":true, "message":"Accounts successfully unlinked." }');
else
	die('{ "success":false, "message":"User not found in database."}');

die('{ "success":false, "message":"Unlink failed." }');
?>
